import request from '@/utils/request'

// 查询考试列表
export function listExam(query) {
  return request({
    url: '/system/exam/list',
    method: 'get',
    params: query
  })
}

// 查询考试详细
export function getExam(id) {
  return request({
    url: '/system/exam/' + id,
    method: 'get'
  })
}

// 新增考试
export function addExam(data) {
  return request({
    url: '/system/exam',
    method: 'post',
    data: data
  })
}

// 修改考试
export function updateExam(data) {
  return request({
    url: '/system/exam',
    method: 'put',
    data: data
  })
}

// 删除考试
export function delExam(id) {
  return request({
    url: '/system/exam/' + id,
    method: 'delete'
  })
}


// 新增考试
export function addExamByBank(addExamByBank) {
  return request({
    url: '/system/exam/addExamByBank',
    method: 'post',
    data: addExamByBank
  })
}

// 自由新增考试
export function addExamByQuestion(addExamByQuestion) {
  return request({
    url: '/system/exam/addExamByQuestion',
    method: 'post',
    data: addExamByQuestion
  })
}

// 查询改题目
export function getExamById(data) {
  return request({
    url: '/system/exam/getExamById',
    method: 'post',
    data: data
  })
}

// 修改考试
export function updateExamInfo(data) {
  return request({
    url: '/system/exam/updateExamInfo',
    method: 'post',
    data: data
  })
}
